﻿package chapter_07_Homework;

import java.util.Scanner;

/*
 * 		购物结算。
 */
public class Work_06 {
	public static void main(String[] args) {
		double[] cashs = new double[5];
		double sum = 0.0;
		System.out.println("请输入本月消费记录：");
		Scanner sc = new Scanner(System.in);
		for (int i = 0; i < cashs.length; i++) {
			System.out.print("请输入第"+(i+1)+"笔消费金额：");
			cashs[i] = sc.nextDouble();
			sum += cashs[i];
		}
		System.out.println("序号"+"\t\t"+"消费金额(元)");
		for (int i = 0; i < cashs.length; i++) {
			System.out.println((i+1)+"\t\t"+cashs[i]);
		}
		System.out.println("消费总金额为："+sum);
	}
}
